package com.reger.l2cache.pipeline.ops;

import java.util.List;
import java.util.Map;
import java.util.Set;

//import org.springframework.data.redis.core.Cursor;
//import org.springframework.data.redis.core.ScanOptions;
import org.springframework.lang.Nullable;

public interface RedisHashPipeline<K, HK, HV> extends RedisKeyPipeline<K> {

	@Nullable
	Boolean hSet(K key, HK field, HV value);

	@Nullable
	Boolean hSetNX(K key, HK field, HV value);

	@Nullable
	HV hGet(K key, HK field);

	@Nullable
	List<HV> hMGet(K key, @SuppressWarnings("unchecked") HK... fields);

	void hMSet(K key, Map<HK, HV> hashes);

	@Nullable
	Long hIncrBy(K key, HK field, long delta);

	@Nullable
	Double hIncrBy(K key, HK field, double delta);

	@Nullable
	Boolean hExists(K key, HK field);

	@Nullable
	Long hDel(K key, @SuppressWarnings("unchecked") HK... fields);

	@Nullable
	Long hLen(K key);

	@Nullable
	Set<HK> hKeys(K key);

	@Nullable
	List<HV> hVals(K key);

	@Nullable
	Map<HK, HV> hGetAll(K key);

//	Cursor<Map.Entry<HK, HV>> hScan(K key, ScanOptions options);

	default RedisHashPipeline<K, HK, HV> toHashPl() {
		return this;
	}
}
